package com.dg11185.nearshop.net.request;

import com.dg11185.libs.network.http.client.HttpRequest;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.NetUtils;
import com.dg11185.nearshop.net.response.SendSmsCodeResponse;

/**
 * 发送注册验证码
 * @author wanliang527
 * @date 2014-4-29
 */
public class SendSmsRegCodeRequest extends HttpRequest<SendSmsCodeResponse> {

    public SendSmsRegCodeRequest(String mobilePhone) {
        super(Constants.ADDRESS, Constants.sendSmsRegCode);
        addParam("mobilePhone", mobilePhone);
        addParam("chshToken", Constants.TOKEN);
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
    }

    @Override
    protected SendSmsCodeResponse parseJson(String response) throws Exception {
        SendSmsCodeResponse res = new SendSmsCodeResponse();
        res.parseJson(response);
        return res;
    }

}
